const express = require('express');
const router = express.Router();
const userController = require('../controllers/userController');

// 自动对数据校验的中间件
const expressJoi = require('@escook/express-joi');
const { userCheck } = require('../utils/check');

// 注册
router.post('/register', expressJoi(userCheck), (userController.registerController));

// 登录
router.post('/login', expressJoi(userCheck), userController.loginController);

// 获取用户数据
router.get('/userInfo', userController.userInfoController);

module.exports = router;